<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>添加或编辑界面</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
    <style>
        .layui-input-inline {
            width: 100%;
            height: 40px;
            line-height: 40px;
        }

        table tr td .layui-form-select dl {
            top: 40px;
            min-width: calc(100% + 20px);
            left: -10px;
        }
    </style>
</head>
<body>
<div class="page-content-wrap clearfix">
    <form class="layui-form" id="tool">
        <div class="layui-tab">
            <div class="layui-tab-content" style="width: 960px; margin: 0 auto">
                    <div class="div-tit-top border0" style="margin-bottom:0px"><span></span>基本信息</div>
                    <table cellpadding="0" cellspacing="0" class="wxyy-item-table marb20" width="100%">
                        <td><span class="red">*</span>任务名称：</td>
                        <td>
                            <input type="text" name="title" id="title" value="${divideClass.title}"
                                   lay-verify="required" placeholder="请输入" class="layui-input wxyy-tab-input"
                                   maxlength="30" autocomplete="off" readonly>
                        </td>
                        <td><span class="red">*</span>分班学段</td>
                        <td>
                            <div class="layui-input-inline">
                                <input name="divideType" id="divideType" class="layui-input wxyy-tab-input" readonly>
                            </div>
                        </td>
                    </table>
                    <div class="div-tit-top border0" style="margin-bottom:0px"><span></span>条件设置</div>
                    <table cellpadding="0" cellspacing="0" class="wxyy-item-table marb20" width="100%">
                        <td>班级数量设置：</td>
                        <td colspan="3">
                            <input type="text" name="classNum" value="${divideClassRule.classNum}" id="classNum"
                                   placeholder="请输入"
                                   class="layui-input wxyy-tab-input" maxlength="30" autocomplete="off" readonly
                            >
                        </td>
                    </table>
                    <table cellpadding="0" cellspacing="0" class="wxyy-item-table marb20" width="100%" id="class">
                        <#if (divideClassClassList??) && (divideClassClassList?size > 0)>
                            <#list divideClassClassList as divideClassClass>
                                <tr>
                                    <td><input hidden name="className" value="${divideClassClass.name}">${divideClassClass.name}
                                    </td>
                                    <td style="width:313px!important">
                                        <input type="text" name="num" value="${divideClassClass.num}" placeholder="请输入"
                                               class="layui-input wxyy-tab-input"
                                               maxlength="30" autocomplete="off" readonly>
                                    </td>
                                    <td>班主任：</td>
                                    <td class="wxyy-td-tetxleft">
                                        <div class="kw-grade-dr"  style="line-height:40px;">
                                            <input type="hidden" class="wxyy-tab-input" name="jkIds"
                                                   value="${divideClassClass.headTeacher}">
                                            <input type="hidden" class="wxyy-tab-input"
                                                   name="jkUserNumber"
                                                   placeholder="请选择监考老师">
                                            <span type="text" class="personlist" name="jkName" autocomplete="off">${divideClassClass.headTeacherName}</span>
                                            <div class="righticon"><i class="iconfont">&#xe6fb;</i></div>
                                        </div>
                                    </td>
                                </tr>
                            </#list>
                        </#if>
                    </table>
                    <div style="border:1px solid #ddd;padding:10px 20px;">
                        <div class="div-checkbox-line">
                            <input type="checkbox" value="0" id="isScore" name="isScore" title="总分均衡" lay-skin="primary"
                                   lay-filter="tjsz"  onclick="return false;">
                            <div class="wc" id="totalError1" name="totalError" style="display: none;">总分误差<span
                                    class="iconfont">&#xe73a;</span><input id="totalError"
                                    type="text" value="${divideClassRule.totalError}" autocomplete="off"></div>
                        </div>
                        <div class="div-checkbox-line">
                            <input type="checkbox" value="1" id="isRank" name="isRank" title="排名均衡（按男女成绩排名循环分配）"
                                   lay-skin="primary"
                                   lay-filter="tjsz"  onclick="return false;">
                        </div>
                        <div class="div-checkbox-line">
                            <input type="checkbox" value="2" id="isSex" name="isSex" title="性别均衡" lay-skin="primary"
                                   lay-filter="tjsz" onclick="return false;">
                        </div>
                    </div>
                  <!--  <div id="drcjbar" style="display:none;">
                        <div class="div-tit-top border0 mart20" style="margin-bottom:0px"><span></span>导入成绩</div>
                        <div style="border:1px solid #ddd;padding:10px 20px;">
                            <button class="layui-btn layui-btn-primary " type="button"
                                    id="selectFile">&#xe612;</i>导入
                            </button>
                        </div>
                    </div>-->
                </div>
            </div>
        </div>
    </form>
</div>
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>
    var divideId = '${divideClass.id}';
    var applyId = '${applyId}';
    var menuId = '${parentMenuId}';
    var divideNum = parseInt('${divideNum}');
    var ruleId = '${divideClassRule.id}';
    layui.use(['jquery', 'form', 'baseutil', 'page', 'table', 'dialog', 'upload'], function () {
        var $ = layui.jquery,
            form = layui.form,
            page = layui.page,
            table = layui.table,
            dialog = layui.dialog,
            upload = layui.upload,
            baseutil = layui.baseutil;
        page.initDict('divideType,sexType', function (dictData) {
            $("#divideType").val(page.aceeptDictContentName(dictData, "divideType", '${divideClass.divideType}'));
        });
        checkStatus();
    });
    function checkStatus() {
        if ('${divideClassRule.isScore}' === '1') {
            $("#isScore").prop("checked", true);
            $("#totalError1").show();
            $("#drcjbar").show();
        }
        if ('${divideClassRule.isRank}' === '1') {
            $("#isRank").prop("checked", true);
            $("#drcjbar").show();
        }
        if ('${divideClassRule.isSex}' === '1') {
            $("#isSex").prop("checked", true);
        }
        layui.form.render();
    }
</script>
</body>
</html>